home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume11 / starchart / part12 < prev    next >
Encoding:
Text File  |  1990-03-15  |  46.5 KB  |  1,755 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v11i040: starchart 3.2 Part 12/32
  3. from: ccount@ATHENA.MIT.EDU
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 11, Issue 40
  7. Submitted-by: ccount@ATHENA.MIT.EDU
  8. Archive-name: starchart/part12
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 12 (of 32)."
  17. # Contents:  starchart/starm2.c starchart/starst.c
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. if test -f 'starchart/starm2.c' -a "${1}" != "-c" ; then 
  20.   echo shar: Will not clobber existing file \"'starchart/starm2.c'\"
  21. else
  22. echo shar: Extracting \"'starchart/starm2.c'\" \(21802 characters\)
  23. sed "s/^X//" >'starchart/starm2.c' <<'END_OF_FILE'
  24. X/*
  25. X * starm2.c, more routines formerly in starchart.c/starmain.c
  26. X *        revision 3.1 August, 1989 
  27. X *
  28. X * Portions Copyright (c) 1987 by Alan Paeth (awpaeth@watcgl)
  29. X *
  30. X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
  31. X *
  32. X * This software may be redistributed freely, not sold.
  33. X * This copyright notice and disclaimer of warranty must remain
  34. X *    unchanged. 
  35. X *
  36. X * No representation is made about the suitability of this
  37. X * software for any purpose.  It is provided "as is" without express or
  38. X * implied warranty, to the extent permitted by applicable law.
  39. X *
  40. X */
  41. X
  42. X
  43. Xstatic char rcsid[]="$Header: starm2.c,v 1.13 90/03/08 20:20:37 ccount Exp $";
  44. X
  45. X#include <stdio.h>
  46. X#include <math.h>
  47. X#ifndef SYSV
  48. X#include <strings.h>
  49. X#else
  50. X#include <string.h>
  51. X#endif
  52. X#include <ctype.h>
  53. X
  54. X#include "star3.h"
  55. X
  56. X#ifndef READMODE
  57. X#define READMODE "r"
  58. X#endif
  59. X#define OPENFAIL 0
  60. X#define LINELEN 82
  61. X
  62. X#ifndef MAXPATHLEN
  63. X#define MAXPATHLEN 1025
  64. X#endif
  65. X
  66. X/* PI / 180 = .0174532925199 */
  67. X#define DCOS(x) (cos((x)*.0174532925199))
  68. X#define DSIN(x) (sin((x)*.0174532925199))
  69. X#define DTAN(x) (tan((x)*.0174532925199))
  70. X#define DASIN(x) (asin(x)/.0174532925199)
  71. X#define DATAN2(x,y) (atan2(x,y)/.0174532925199)
  72. X#define MAX(a,b) ((a)>(b)?(a):(b))
  73. X#define MIN(a,b) ((a)<(b)?(a):(b))
  74. X
  75. Xextern int cur_function;
  76. Xextern int cur_map_type;
  77. Xextern int cur_map_tag;
  78. Xextern char *cur_tag_field;
  79. Xextern char *cur_file_name;
  80. Xextern user_interact;
  81. Xextern precess;
  82. X
  83. X/* Set by initxform
  84. X   One could use elements of the mapwindow structure,
  85. X   but these should be faster for the current window */
  86. Xextern int xproj_mode;
  87. Xextern double xwest, xeast, xnorth, xsouth, xbot;
  88. Xextern int cenx, ceny, strty;
  89. Xextern double xracen, sindlcen, cosdlcen, chart_scale;
  90. Xextern double yscale;
  91. Xextern double xc_scale;
  92. Xextern double inv_;
  93. X
  94. X/* xform globals */
  95. Xextern double xf_west, xf_east, xf_north, xf_south, xf_bottom;
  96. Xextern int xf_xcen, xf_ycen, xf_ybot;
  97. Xextern int xf_w_left, xf_w_right, xf_w_top, xf_w_bot;
  98. X
  99. Xextern double xf_c_scale;
  100. X
  101. X
  102. Xextern int htick_lim, htext_lim;
  103. Xextern int htext_xoff, htext_yoff;
  104. Xextern int vtick_lim, vtext_lim;
  105. Xextern int vtext_xoff, vtext_yoff;
  106. X
  107. X
  108. Xextern char *boundfile;
  109. Xextern char boundftype;
  110. Xextern char *patternfile;
  111. Xextern char pattftype;
  112. Xextern char *cnamefile;
  113. Xextern char cnameftype;
  114. Xextern char *mapfiles[];
  115. Xextern int mapftypes[];
  116. Xextern int nummapfiles;
  117. X
  118. Xextern char *progname;
  119. X
  120. X/* read file function indirection to allow for use of alternate file readers */
  121. Xint readstar();
  122. Xint buf_readstar();
  123. Xextern int (*readfile)();
  124. X
  125. X/* Readstar globals */
  126. Xextern double obj_lat, obj_lon, obj_mag;
  127. Xextern char obj_type[], obj_color[], obj_label[];
  128. Xextern char obj_constell[], obj_name[];
  129. Xextern char *obj_commnt, fileline[];
  130. X
  131. X
  132. X/* Chart element routines */
  133. X
  134. X/* Uses xf_north etc. from initxform */
  135. Xchartoutline(win)
  136. X     mapwindow *win;
  137. X{
  138. X  double start, inc;
  139. X  int xloc, xloc2, yloc, yloc2, div, i;
  140. X  int inregion;
  141. X  int R;
  142. X  double phi;
  143. X
  144. X  cur_function = CHRTOUTLN;
  145. X
  146. X  if (win->proj_mode == STEREOGR) {
  147. X    R = MIN(win->height, win->width) / 2 + 1;
  148. X    D_move(xf_xcen, xf_ycen+R);
  149. X    for (phi = 5.0; phi <= 360.0; phi += 5.0)
  150. X      D_draw(xf_xcen + (int)(R*DSIN(phi) + 0.5), 
  151. X         xf_ycen + (int)(R*DCOS(phi) + 0.5), SOLID);
  152. X  } else if (win->proj_mode == SANSONS) {
  153. X    xform(xf_south, xf_west, &xloc,  &yloc, &inregion);
  154. X    xform(xf_south, xf_east, &xloc2, &yloc2, &inregion);
  155. X    D_movedraw(xloc, yloc, xloc2, yloc2, SOLID);
  156. X    xform(xf_north, xf_west, &xloc,  &yloc, &inregion);
  157. X    xform(xf_north, xf_east, &xloc2, &yloc2, &inregion);
  158. X    D_movedraw(xloc, yloc, xloc2, yloc2, SOLID);
  159. X    
  160. X    inc = (xf_north - xf_south);
  161. X    div = (int)(inc);
  162. X    if (div < 1) div = 1;
  163. X    inc /= div;
  164. X    start = xf_south;
  165. X    xform(start, xf_west, &xloc, &yloc, &inregion);
  166. X    D_move(xloc, yloc);
  167. X    for (i=0; i < div; i++) {
  168. X      start += inc;
  169. X      xform(start, xf_west, &xloc, &yloc, &inregion);
  170. X      D_draw(xloc, yloc, SOLID);
  171. X    }
  172. X    start = xf_south;
  173. X    xform(start, xf_east, &xloc, &yloc, &inregion);
  174. X    D_move(xloc, yloc);
  175. X    for (i=0; i < div; i++) {
  176. X      start += inc;
  177. X      xform(start, xf_east, &xloc, &yloc, &inregion);
  178. X      D_draw(xloc, yloc, SOLID);
  179. X    }
  180. X    charthgrid(win, 15.0, 18);
  181. X    charthgrid(win, 5.0, 12);
  182. X    charthgrid(win, 1.0, 6);
  183. X    chartvgrid(win, 10.0, 18);
  184. X    chartvgrid(win, 5.0 , 12);
  185. X    chartvgrid(win, 1.0, 6);
  186. X  } else if (win->proj_mode == RECTANGULAR) {
  187. X    xform(xf_south, xf_west, &xloc,  &yloc, &inregion);
  188. X    xform(xf_south, xf_east, &xloc2, &yloc2, &inregion);
  189. X    D_movedraw(xloc, yloc, xloc2, yloc2, SOLID);
  190. X    xform(xf_north, xf_west, &xloc,  &yloc, &inregion);
  191. X    xform(xf_north, xf_east, &xloc2, &yloc2, &inregion);
  192. X    D_movedraw(xloc, yloc, xloc2, yloc2, SOLID);
  193. X
  194. X    xform(xf_north, xf_west, &xloc,  &yloc, &inregion);
  195. X    xform(xf_south, xf_west, &xloc2, &yloc2, &inregion);
  196. X    D_movedraw(xloc, yloc, xloc2, yloc2, SOLID);
  197. X    xform(xf_north, xf_east, &xloc,  &yloc, &inregion);
  198. X    xform(xf_south, xf_east, &xloc2, &yloc2, &inregion);
  199. X    D_movedraw(xloc, yloc, xloc2, yloc2, SOLID);
  200. X    
  201. X    charthgrid(win, 15.0, 18);
  202. X    charthgrid(win, 5.0, 12);
  203. X    charthgrid(win, 1.0, 6);
  204. X    chartvgrid(win, 10.0, 18);
  205. X    chartvgrid(win, 5.0 , 12);
  206. X    chartvgrid(win, 1.0, 6);
  207. X  } else { /* GNOMONIC or ORTHOGR */
  208. X    D_movedraw(xf_w_left, xf_w_bot, xf_w_right, xf_w_bot, SOLID);
  209. X    D_movedraw(xf_w_right, xf_w_bot, xf_w_right, xf_w_top, SOLID);
  210. X    D_movedraw(xf_w_right, xf_w_top, xf_w_left, xf_w_top, SOLID);
  211. X    D_movedraw(xf_w_left, xf_w_top, xf_w_left, xf_w_bot, SOLID);
  212. X  }
  213. X}
  214. X
  215. Xcharthgrid(win, inc, hgt)
  216. X     mapwindow *win;
  217. X     double inc;
  218. X     int hgt;
  219. X{
  220. X  double start, stop, ras;
  221. X  int xloc, xloc2, yloc, xloc3, yloc3;
  222. X  int inregion;
  223. X
  224. X  cur_function = CHRTHTICK;
  225. X
  226. X/* r.a. ticks always appear at the bottom, regardless of (invert) */
  227. X/* xf_bottom is the bottom, wether north or south, set in intixform */
  228. X  start = modup(xf_west, inc);
  229. X  stop = moddown(xf_east, inc);
  230. X  xform(xf_bottom, start, &xloc, &yloc, &inregion);
  231. X  xform(xf_bottom, start+inc, &xloc2, &yloc, &inregion);
  232. X  if (xloc - xloc2 > htick_lim)
  233. X    for (ras = start; ras <= stop; ras += inc)
  234. X      {
  235. X    xform(xf_bottom, ras, &xloc3, &yloc3, &inregion);
  236. X    D_movedraw(xloc3, yloc3-hgt, xloc3, yloc3, SOLID);
  237. X    if (xloc - xloc2 > htext_lim)
  238. X      {
  239. X        char tstr[20];
  240. X        rastr(tstr, ras);
  241. X        D_fontsize(10, HELV);
  242. X        D_text(xloc3+htext_xoff, yloc-htext_yoff, tstr, FALSE);
  243. X      }
  244. X      }
  245. X}
  246. X
  247. Xchartvgrid(win, inc, wid)
  248. X     mapwindow *win;
  249. X     double inc;
  250. X     int wid;
  251. X{
  252. X  double start, stop, dl;
  253. X  int xloc, yloc, yloc2, xloc3, yloc3;
  254. X  int inregion;
  255. X  
  256. X  cur_function = CHRTVTICK;
  257. X
  258. X  start = modup(xf_south, inc);
  259. X  stop = moddown(xf_north, inc);
  260. X  xform(start, xf_west, &xloc, &yloc, &inregion);
  261. X  xform(start+inc, xf_west, &xloc, &yloc2, &inregion);
  262. X  if (abs(yloc2 - yloc) > vtick_lim)
  263. X    {
  264. X      for (dl = start; dl <= stop; dl += inc)
  265. X    {
  266. X      xform(dl, xf_west, &xloc3, &yloc3, &inregion);
  267. X      D_movedraw(xloc3, yloc3, xloc3+wid, yloc3, SOLID);
  268. X      if (abs(yloc2 - yloc) > vtext_lim)
  269. X        {
  270. X          char tstr[20];
  271. X          declstr(tstr, dl);
  272. X          D_fontsize(10, HELV);
  273. X          D_text(xloc3+vtext_xoff, yloc3+vtext_yoff, tstr, FALSE);
  274. X        }
  275. X    }
  276. X    }
  277. X}
  278. X
  279. Xdouble modup(a, b)
  280. X     double a, b;
  281. X{
  282. X  double new;
  283. X  new = ((double)((int)(a/b))*b);
  284. X  if (new >= a) return(new);
  285. X  return(new += b);
  286. X}
  287. X
  288. Xdouble moddown(a, b)
  289. X     double a, b;
  290. X{
  291. X  double new;
  292. X  new = ((double)((int)(a/b))*b);
  293. X  if (new <= a) return(new);
  294. X  return (new -= b);
  295. X}
  296. X
  297. X/* return TRUE if a (in degrees) is west of b */
  298. X/* west is towards lower values of RA, e.g. 60 is west of 90 */
  299. Xint westof(a, b)
  300. X     double a, b;
  301. X{
  302. X  double diff;
  303. X
  304. X  diff = b - a;
  305. X  if (diff > 180) diff -= 360;
  306. X  if (diff < -180) diff += 360;
  307. X
  308. X  return (diff > 0);
  309. X}
  310. X
  311. X
  312. X/* return TRUE if a (in degrees) is east of b */
  313. X/* east is towards higher values of RA, e.g. 90 is east of 60 */
  314. Xint eastof(a, b)
  315. X     double a, b;
  316. X{
  317. X  double diff;
  318. X
  319. X  diff = b - a;
  320. X  if (diff > 180) diff -= 360;
  321. X  if (diff < -180) diff += 360;
  322. X
  323. X  return (diff < 0);
  324. X}
  325. X
  326. Xrastr(str, ras)
  327. X     char *str;
  328. X     double ras;
  329. X{
  330. X  int hrs, min;
  331. X  if (ras <   0.0) ras += 360.0;
  332. X  if (ras > 360.0) ras -= 360.0;
  333. X  hrs = (int)(ras/15.0);
  334. X  min = (int)((ras - hrs * 15.0) * 4.0);
  335. X  sprintf(str, "%2dh", hrs);
  336. X  if (min) sprintf(str, "%s%02dm", str, min);
  337. X}
  338. X
  339. Xdeclstr(str, dl)
  340. X     char *str;
  341. X     double dl;
  342. X{
  343. X  int deg, min;
  344. X  if (dl == 0.0) sprintf(str, "%s", " ");
  345. X  else if (dl > 0.0) sprintf(str, "%s", "+");
  346. X  else
  347. X    {
  348. X      sprintf(str, "%s", "-");
  349. X      dl = -dl;
  350. X    }
  351. X  deg = (int)(dl);
  352. X  min = (int)((dl - deg) * 60.0);
  353. X  sprintf(str, "%s%02dd", str, deg);
  354. X  if (min) sprintf(str, "%s%02dm", str, min);
  355. X}
  356. X
  357. Xchartragrid(win)
  358. X     mapwindow *win;
  359. X{
  360. X  double glonc, glatc, glon;
  361. X  double olon, olat;
  362. X  int xloc, yloc, xloc2, yloc2;
  363. X  double tlat1, tlon1, tlat2, tlon2;
  364. X
  365. X  if (!win->draw_ragrid) return;
  366. X  
  367. X  cur_function = GRID_RA;
  368. X
  369. X  for (glonc = 0.0; glonc <= 360.0; glonc += win->ra_step) {
  370. X    glon = glonc + win->ra_strt;
  371. X    if (glon < 0.0) glon += 360.0;
  372. X    if (glon > 360.0) glon -= 360.0;
  373. X    olon = glon;
  374. X    olat = glatc = -90.0;
  375. X    for (glatc = -90.0; glatc <= 90.0; glatc += 10.0) {
  376. X      if (clipr_xform(olat, olon, glatc, glon,
  377. X              &xloc, &yloc, &xloc2, &yloc2, TRUE,
  378. X              &tlat1, &tlon1, &tlat2, &tlon2)) {
  379. X    drawcurveline(tlat1, tlon1, tlat2, tlon2,
  380. X              xloc, yloc, xloc2, yloc2, DOTTED, TRUE, 0);
  381. X      }
  382. X      olat = glatc;
  383. X    }
  384. X  }
  385. X}
  386. X
  387. Xchartdecgrid(win)
  388. X     mapwindow *win;
  389. X{
  390. X  double glonc, glatc, glat;
  391. X  double olon, olat;
  392. X  int xloc, yloc, xloc2, yloc2;
  393. X  double tlat1, tlon1, tlat2, tlon2;  
  394. X  
  395. X  if (!win->draw_decgrid) return;
  396. X  
  397. X  cur_function = GRID_DEC;
  398. X  
  399. X  for (glatc = 0; glatc <= 90.0; glatc += win->dec_step) {
  400. X    glat = glatc + win->dec_strt;
  401. X    if (glat < 0.0) glat = 0.0;
  402. X    if (glat > 90.0) glat = 90.0;
  403. X    olat = glat;
  404. X    olon = glonc = 0.0;
  405. X    for (glonc = 0.0; glonc <= 360.0; glonc += 10.0) {
  406. X      if (clipr_xform(olat, olon, glat, glonc,
  407. X              &xloc, &yloc, &xloc2, &yloc2, FALSE,
  408. X              &tlat1, &tlon1, &tlat2, &tlon2)) {
  409. X    drawcurveline(tlat1, tlon1, tlat2, tlon2,
  410. X              xloc, yloc, xloc2, yloc2, DOTTED, FALSE, 0);
  411. X      }
  412. X      olon = glonc;
  413. X    }
  414. X  }
  415. X  for (glatc = 0; glatc >= -90.0; glatc -= win->dec_step) {
  416. X    glat = glatc + win->dec_strt;
  417. X    if (glat < -90.0) glat = -90.0;
  418. X    if (glat > 0.0) glat = 0.0;
  419. X    olat = glat;
  420. X    olon = glonc = 0.0;
  421. X    for (glonc = 0.0; glonc <= 360.0; glonc += 10.0) {
  422. X      if (clipr_xform(olat, olon, glat, glonc,
  423. X              &xloc, &yloc, &xloc2, &yloc2, FALSE,
  424. X              &tlat1, &tlon1, &tlat2, &tlon2)) {
  425. X    drawcurveline(tlat1, tlon1, tlat2, tlon2,
  426. X              xloc, yloc, xloc2, yloc2, DOTTED, FALSE, 0);
  427. X      }
  428. X      olon = glonc;
  429. X    }
  430. X  }
  431. X}
  432. X
  433. X
  434. X
  435. Xchartecliptic(win)
  436. X     mapwindow *win;
  437. X{
  438. X  double sineps, coseps;
  439. X  int i;
  440. X  double lat, lon, olat, olon;
  441. X  int xloc, yloc, xloc2, yloc2;
  442. X  double tlat1, tlon1, tlat2, tlon2;  
  443. X
  444. X  cur_function = ECLIPT;
  445. X
  446. X  sineps = DSIN(23.439);
  447. X  coseps = DCOS(23.439);
  448. X  
  449. X  olat = 0.0;
  450. X  olon = 0.0;
  451. X  for (i = 1; i <= 361; i += 10) {
  452. X    lat = DASIN(sineps*DSIN(i));
  453. X    lon = DATAN2((coseps*DSIN(i)), (DCOS(i)));
  454. X    if (lon < 0.0) lon += 360.0; /* Eliminate discontinuity at -180 */
  455. X    if (clipr_xform(olat, olon, lat, lon,
  456. X            &xloc, &yloc, &xloc2, &yloc2, FALSE,
  457. X            &tlat1, &tlon1, &tlat2, &tlon2)) {
  458. X    drawcurveline(tlat1, tlon1, tlat2, tlon2,
  459. X              xloc, yloc, xloc2, yloc2, DASHED, TRUE, 0);
  460. X
  461. X    }
  462. X    olat = lat;
  463. X    olon = lon;
  464. X  }
  465. X}
  466. X
  467. X
  468. Xchartboundaries(win)
  469. X     mapwindow *win;
  470. X{
  471. X  FILE *sfile;
  472. X  if ((sfile = fopen(boundfile, READMODE)) == OPENFAIL) return(0);
  473. X
  474. X  cur_function = CONSTBOUND;
  475. X  cur_file_name = boundfile;
  476. X
  477. X  chartobjects(win, sfile, boundftype, 100.0, 100.0, -100.0,
  478. X                /* maglim, lbllim low, gklim high */
  479. X           FALSE, 100.0, -100.0, ALLFILES);
  480. X                /* don't label with magnitudes */
  481. X  fclose(sfile);
  482. X
  483. X  cur_file_name = "";
  484. X
  485. X  return(1);
  486. X}
  487. X
  488. Xchartpatterns(win)
  489. X     mapwindow *win;
  490. X{
  491. X  FILE *sfile;
  492. X  if ((sfile = fopen(patternfile, READMODE)) == OPENFAIL) return(0);
  493. X
  494. X  cur_function = CONSTPATTRN;
  495. X  cur_file_name = patternfile;
  496. X
  497. X  chartobjects(win, sfile, pattftype, 100.0, 100.0, -100.0,
  498. X                /* maglim, lbllim low, gklim high */
  499. X           FALSE, 100.0, -100.0, ALLFILES);
  500. X                /* don't label with magnitudes */
  501. X  fclose(sfile);
  502. X
  503. X  cur_file_name = "";
  504. X
  505. X  return(1);
  506. X}
  507. X
  508. Xchartconstlnames(win)
  509. X     mapwindow *win;
  510. X{
  511. X  FILE *sfile;
  512. X  if ((sfile = fopen(cnamefile, READMODE)) == OPENFAIL) return(0);
  513. X
  514. X  cur_function = CONSTNAME;
  515. X  cur_file_name = cnamefile;
  516. X
  517. X  chartobjects(win, sfile, cnameftype, 100.0, 100.0, -100.0,
  518. X                /* maglim, lbllim low, gklim high */
  519. X           FALSE, 100.0, -100.0, ALLFILES);
  520. X                /* don't label with magnitudes */
  521. X  fclose(sfile);
  522. X
  523. X  cur_file_name = "";
  524. X
  525. X  return(1);
  526. X}
  527. X
  528. Xchartmain(win, draw_mode)
  529. X     mapwindow *win;
  530. X     int draw_mode;
  531. X{
  532. X  int i;
  533. X  char commline[132];
  534. X  
  535. X  for(i=0;i < win->numfiles; i++) {
  536. X#ifdef INTERACTIVE_CONTROL
  537. X    if (user_interact)
  538. X      if (D_break()) break;
  539. X#endif
  540. X    sprintf(commline, "file %d, type %d, '%s'\n",i,win->file[i].type,
  541. X        win->file[i].name);
  542. X    D_comment(commline);
  543. X    if (!chartfile(win, win->file[i].name, win->file[i].type,
  544. X           win->file[i].maglim, win->file[i].lbllim, 
  545. X           win->file[i].gklim, win->file[i].draw_maglbl,
  546. X           win->file[i].maglmin, win->file[i].maglmax, draw_mode))
  547. X      fprintf(stderr, "%s: error, open fail on '%s'\n",
  548. X          progname, win->file[i].name);
  549. X  }
  550. X  D_color("  ");        /* Reset color */
  551. X}
  552. X
  553. Xchartfile(win, filename, filetype, maglim, lbllim, gklim,
  554. X      draw_maglbl, maglmin, maglmax, draw_mode)
  555. X     mapwindow *win;
  556. X     char *filename;
  557. X     int filetype;
  558. X     double maglim, lbllim, gklim;
  559. X     int draw_maglbl;
  560. X     double maglmin, maglmax;
  561. X     int draw_mode;
  562. X{
  563. X  FILE *file1, *file2;
  564. X  double padding;
  565. X  double f_east, f_north, f_west, f_south;
  566. X  char ibuf[2020], fname[1030], ftypestr[32], commline[1200];
  567. X  int n;
  568. X  int xloc, yloc, inr1, inr2, inr3, inr4;
  569. X  int usethis;
  570. X  int ftype;
  571. X
  572. X  if ((file1 = fopen(filename, READMODE)) == OPENFAIL) return(FALSE);
  573. X
  574. X  cur_function = CHARTFILE;
  575. X  cur_file_name = filename;
  576. X
  577. X  if (filetype == INDEXTYPE) {
  578. X    /* read each line of index file, parse data on the files indexed:
  579. X       region included file name
  580. X         use an indexed file
  581. X        if any corner is in the plot region,
  582. X       or if the center of the plot is in the file region */
  583. X    /* file region is padded to avoid possible problems with
  584. X       corners being out of the plot but some part falling in the area
  585. X       which may occur in some clip windows shapes */
  586. X    if ((win->proj_mode == STEREOGR) || (win->proj_mode == GNOMONIC)
  587. X    || (win->proj_mode == ORTHOGR))
  588. X      padding = win->scale;
  589. X    else padding = 1.0;
  590. X
  591. X    while (!feof(file1)) {
  592. X#ifdef INTERACTIVE_CONTROL
  593. X      if (user_interact)
  594. X    if (D_break()) break;
  595. X#endif
  596. X      fgets(ibuf, 2000, file1);
  597. X      n = sscanf(ibuf, "%lf %lf %lf %lf %1000s %30s\n", &f_east, &f_north,
  598. X         &f_west, &f_south, fname, ftypestr);
  599. X      if ((n != 6) || feof(file1)) continue;
  600. X
  601. X      f_east *= 15.0;
  602. X      f_west *= 15.0;
  603. X
  604. X      f_east += padding;
  605. X      f_west -= padding;
  606. X      f_north += padding;
  607. X      f_south -= padding;
  608. X      if (f_east > 360.0) f_east -= 360.0;
  609. X      if (f_west < 0.0) f_west += 360.0;
  610. X      if (f_north > 90.0) f_north = 90.0;
  611. X      if (f_south < -90.0) f_south = -90.0;
  612. X
  613. X      xform(f_north, f_east, &xloc, &yloc, &inr1);
  614. X      xform(f_south, f_east, &xloc, &yloc, &inr2);
  615. X      xform(f_north, f_west, &xloc, &yloc, &inr3);
  616. X      xform(f_south, f_west, &xloc, &yloc, &inr4);
  617. X
  618. X      usethis = (inr1 || inr2 || inr3 || inr4);
  619. X
  620. X      /* If any corner of the file is in the region, use it. (test done above)
  621. X     Otherwise if any corner of the region is in the file, use the file.
  622. X     Uses xf_north, xf_south, xf_east, xf_west set by initxform()
  623. X     Note, east is left when you look at the sky */
  624. X
  625. X      if (!usethis) {
  626. X    usethis |= ((xf_north >= f_south) && (xf_north <= f_north)
  627. X            && (eastof(xf_east,f_west)) && (westof(xf_east,f_east)));
  628. X                                                  /* Upper left is in */
  629. X    usethis |= ((xf_north >= f_south) && (xf_north <= f_north)
  630. X            && (eastof(xf_west,f_west)) && (westof(xf_west,f_east)));
  631. X                                                  /* Upper right is in */
  632. X    usethis |= ((xf_south >= f_south) && (xf_south <= f_north)
  633. X            && (eastof(xf_east,f_west)) && (westof(xf_east,f_east)));
  634. X                                                  /* lower left is in */
  635. X    usethis |= ((xf_south >= f_south) && (xf_south <= f_north)
  636. X            && (eastof(xf_west,f_west)) && (westof(xf_west,f_east)));
  637. X                                                  /* lower right is in */
  638. X    usethis |= (
  639. X            (  ((xf_north >= f_south) && (xf_north <= f_north))
  640. X             ||((xf_south >= f_south) && (xf_south <= f_north))
  641. X             ||((f_north >= xf_south) && (f_north <= xf_north))
  642. X             ||((f_south >= xf_south) && (f_south <= xf_north))
  643. X             )
  644. X            &&
  645. X            (  ((eastof(xf_east,f_west)) && (westof(xf_east,f_east)))
  646. X             ||((eastof(xf_west,f_west)) && (westof(xf_west,f_east)))
  647. X             ||((eastof(f_east,xf_west)) && (westof(f_east,xf_east)))
  648. X             ||((eastof(f_west,xf_west)) && (westof(f_west,xf_east)))
  649. X             )
  650. X            );
  651. X                /* North or south of area is between
  652. X                   north and south boundaries,
  653. X                   and east or west of area is between
  654. X                   east and west boundaries. */
  655. X      }
  656. X
  657. X      if (usethis) {
  658. X    if ((file2 = fopen(fname, READMODE)) == OPENFAIL) {
  659. X      fprintf(stderr, "%s: error, couldn't open '%s' for reading.\n",
  660. X          progname, fname);
  661. X    } else {
  662. X      cur_file_name = fname;
  663. X
  664. X      ftype = tr_fty(ftypestr);
  665. X      sprintf(commline, "'%s', type %d\n",fname, ftype);
  666. X      D_comment(commline);
  667. X      if (ftype == INDEXTYPE)  {
  668. X        fprintf(stderr,
  669. X  "%s: error, can't use type INDEXTYPE file '%s' from another index file.\n",
  670. X            progname, fname);
  671. X      } else {
  672. X        chartobjects(win, file2, ftype, maglim, lbllim, gklim,
  673. X             draw_maglbl, maglmin, maglmax, draw_mode);
  674. X      }
  675. X      fclose(file2);
  676. X      cur_file_name = "";
  677. X    }
  678. X      }
  679. X    }
  680. X  } else {
  681. X    chartobjects(win, file1, filetype, maglim, lbllim, gklim,
  682. X         draw_maglbl, maglmin, maglmax, draw_mode);
  683. X  }
  684. X  fclose(file1);
  685. X  cur_file_name = "";
  686. X  return(TRUE);
  687. X}
  688. X
  689. X
  690. Xdouble o_lat, o_lon;        /* save areas for track clipping */
  691. Xchar area_stat;
  692. X
  693. Xchartobjects(win, file, ftype, maglim, lbllim, gklim,
  694. X         draw_maglbl, maglmin, maglmax, draw_mode)
  695. X     mapwindow *win;
  696. X     FILE *file;
  697. X     int ftype;
  698. X     double maglim, lbllim, gklim;
  699. X     int draw_mode;
  700. X     int draw_maglbl;
  701. X     double maglmin, maglmax;
  702. X{
  703. X  int xloc, yloc, xloc2, yloc2;
  704. X  int inregion;
  705. X  double tlat1, tlon1, tlat2, tlon2;
  706. X  int glyph_mode, name_mode, magl_mode, vec_mode, area_mode, all_mode;
  707. X  int use_label, use_name, use_mag;
  708. X
  709. X  /* Modes:
  710. X     ALLGLYPHS        All symbols
  711. X     ALLNAMES        All names (and greek)
  712. X     ALLMAGLBLS        All magnitude labels
  713. X     ALLVECTORS        All vectors
  714. X     ALLAREAS        All areas
  715. X     ALLFILES        All of the above
  716. X  */
  717. X
  718. X  glyph_mode = ((draw_mode == ALLFILES) || (draw_mode == ALLGLYPHS));
  719. X  name_mode = ((draw_mode == ALLFILES) || (draw_mode == ALLNAMES));
  720. X  magl_mode = ((draw_mode == ALLFILES) || (draw_mode == ALLMAGLBLS));
  721. X  vec_mode = ((draw_mode == ALLFILES) || (draw_mode == ALLVECTORS));
  722. X  area_mode = ((draw_mode == ALLFILES) || (draw_mode == ALLAREAS));
  723. X  all_mode = (draw_mode == ALLFILES);
  724. X  
  725. X  for(;;) {
  726. X    if ((*readfile)(file, ftype)) break;
  727. X/*    if ((obj_mag > maglim) && (obj_type[0] == 'S')) break;*/
  728. X
  729. X    if (obj_type[0] == '#') continue;
  730. X
  731. X#ifdef INTERACTIVE_CONTROL
  732. X    if (user_interact)
  733. X      if (D_break()) break;
  734. X#endif
  735. X
  736. X    if ( (obj_mag <= maglim) )
  737. X      {
  738. X    if (precess) do_precess(&obj_lat, &obj_lon);
  739. X    xform(obj_lat, obj_lon, &xloc, &yloc, &inregion);
  740. X    if ((!inregion) && (obj_type[0] != 'V')
  741. X        && (obj_type[0] != 'A')) continue;
  742. X    use_label = (((obj_type[0] == 'S') || (obj_type[0] == 'I')) &&
  743. X             (obj_mag <= gklim) &&
  744. X             (all_mode || name_mode));
  745. X    use_name =  ((obj_mag <= lbllim) && name_mode);
  746. X    use_mag =  (draw_maglbl && (obj_mag <= maglmax) &&
  747. X            (obj_mag >= maglmin) && magl_mode);
  748. X
  749. X    if (inregion)
  750. X      drawobj(xloc, yloc, obj_mag, obj_type, obj_color, obj_label,
  751. X          obj_constell, obj_name,
  752. X          obj_commnt, fileline,
  753. X          glyph_mode,
  754. X          name_mode || magl_mode,
  755. X          use_label,
  756. X          use_name,
  757. X          use_mag);
  758. X    if (obj_type[0] == 'V') {
  759. X      D_color(obj_color);
  760. X      if ((obj_type[1] == 'M') || (obj_type[1] == 'm')) {     /* move */
  761. X        o_lat = obj_lat;
  762. X        o_lon = obj_lon;
  763. X      } else {             /* draw */
  764. X        if (vec_mode && clipr_xform(o_lat, o_lon, obj_lat, obj_lon,
  765. X                    &xloc, &yloc, &xloc2, &yloc2,
  766. X                    (isupper(obj_type[1])),
  767. X                    &tlat1, &tlon1, &tlat2, &tlon2)) {
  768. X          switch (obj_type[1]) {
  769. X          case 'D':
  770. X          case 'd':
  771. X        drawcurveline(tlat1, tlon1, tlat2, tlon2, xloc, yloc,
  772. X                  xloc2, yloc2, VECDOT, (obj_type[1] == 'D'), 0);
  773. X        break;
  774. X          case 'H':
  775. X          case 'h':
  776. X        drawcurveline(tlat1, tlon1, tlat2, tlon2, xloc, yloc,
  777. X                  xloc2, yloc2, VECDASH, (obj_type[1] == 'H'), 0);
  778. X        break;
  779. X          case 'S':
  780. X          case 's':
  781. X          default:
  782. X        drawcurveline(tlat1, tlon1, tlat2, tlon2, xloc, yloc,
  783. X                  xloc2, yloc2, VECSOLID, isupper(obj_type[1]), 0);
  784. X        break;
  785. X
  786. X          }
  787. X        }
  788. X        o_lat = obj_lat;
  789. X        o_lon = obj_lon;
  790. X      }
  791. X      D_color("  ");
  792. X    } else if ((obj_type[0] == 'A') && area_mode) {
  793. X      D_color(obj_color);
  794. X      if ((obj_type[1] == 'M') || (obj_type[1] == 'm')) {
  795. X                /* move */
  796. X        areastart(obj_lat, obj_lon, (obj_type[1] == 'M'));
  797. X        area_stat = 'M';
  798. X      } else if ((obj_type[1] == 'A') || (obj_type[1] == 'a')) {
  799. X                /* add segment */
  800. X        areaadd(obj_lat, obj_lon, (obj_type[1] == 'A'));
  801. X        area_stat = obj_type[1];
  802. X      } else if ((obj_type[1] == 'F') || (obj_type[1] == 'f')) {
  803. X                /* fill */
  804. X        if ((area_stat == 'A') || (area_stat == 'a'))
  805. X                /* Else, likely an error */
  806. X          areaadd(obj_lat, obj_lon, (obj_type[1] == 'F'));
  807. X        areafinish();
  808. X        area_stat = obj_type[1];
  809. X      };
  810. X      D_color("  ");
  811. X    }
  812. X      }
  813. X  }
  814. X}
  815. END_OF_FILE
  816. if test 21802 -ne `wc -c <'starchart/starm2.c'`; then
  817.     echo shar: \"'starchart/starm2.c'\" unpacked with wrong size!
  818. fi
  819. # end of 'starchart/starm2.c'
  820. fi
  821. if test -f 'starchart/starst.c' -a "${1}" != "-c" ; then 
  822.   echo shar: Will not clobber existing file \"'starchart/starst.c'\"
  823. else
  824. echo shar: Extracting \"'starchart/starst.c'\" \(21986 characters\)
  825. sed "s/^X//" >'starchart/starst.c' <<'END_OF_FILE'
  826. X/*
  827. X * GDOS Display driver for starchart.c ATARI ST - Version
  828. X */
  829. X
  830. X/*
  831. X * Modified from 2.1 to starchart 3.0.  Holger Zessel, Nov 1989
  832. X */
  833. Xstatic char rcsid[]="$Header: starst.c,v 1.1 90/03/08 20:14:37 ccount Exp $";
  834. X
  835. X#include <stdio.h>
  836. X#include <math.h>
  837. X#ifndef SYSV
  838. X#include <strings.h>
  839. X#else
  840. X#include <string.h>
  841. X#endif
  842. X#include <ctype.h>    /* isprint(), iscntrl(), etc. */
  843. X#include <osbind.h>   /* Operating system bindings */
  844. X#include <vdibind.h>  /* The virtual device interface routines */
  845. X#include <stdio.h>
  846. X#include "star3.h" /* Starchart information */
  847. X
  848. X/* Global line A variables used by vdi; MUST be included */
  849. Xint contrl[12], intin[128], ptsin[128], intout[128], ptsout[128];
  850. X/* Array used by vs_clip() */
  851. Xint cliparray[] = { 0, 0, 32767, 32767 };
  852. X
  853. Xint work_in[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 };
  854. Xint work_out[57];
  855. Xint dummy;
  856. Xint vdihandle; /* Virtual device's handle */
  857. Xint vdihandle_save;
  858. Xint device=1; /* GDOS-Outputdevice */
  859. X
  860. X#define TRUE 1
  861. X#ifdef NULL
  862. X#undef NULL
  863. X#endif
  864. X#define NULL 0
  865. X    
  866. X/*
  867. X** Starchart was designed for 1024x768 pixels.  These macros scale the
  868. X** image to the 32768*32768 Atari ST GDOS-resolution in normalized mode.
  869. X*/
  870. X#define xadjust(x) ((x) * 32)
  871. X#define yadjust(y) ((y) * 42.667)
  872. X
  873. X
  874. X/* Externs */
  875. Xextern int g_argc;
  876. Xextern char **g_argv;
  877. X
  878. Xextern char *title;    /* Title of page */
  879. X
  880. Xextern mapwindow *mapwin[MAXWINDOWS];
  881. Xextern int numwins;
  882. X
  883. Xextern int cur_function;
  884. Xextern int cur_map_type;
  885. Xextern int cur_map_tag;
  886. Xextern char *cur_tag_field;
  887. X
  888. X
  889. X/* Scale multiplier, minimum,
  890. X   magnitude change, maximum, for thumbnail,*/
  891. X#define THSMUL 1.2
  892. X#define THSMIN 12.0
  893. X#define THMADJ 2.5
  894. X#define THMMAX 5.0
  895. X
  896. X
  897. X/* Exports */
  898. X
  899. X/* The variables in the first few lines MUST be set by driver */
  900. Xmapwindow fullpage = {
  901. X  880, 700, 20, 65,    /* width, height, x and y offsets */
  902. X  5.9, 2.0, 2.05,    /* default limiting mags for glyph, name, label */
  903. X
  904. X/* The next several variables SHOULD be set by the driver,
  905. X   but are only used by the driver */
  906. X  FULLPAGEMAP,        /* Type of map: THUMBNAIL may have
  907. X               some restrictions */
  908. X  0,            /* May be used by driver for whatever */
  909. X  "String",        /* May be used by driver for whatever */
  910. X  
  911. X/* The next several variables may be set by the driver, but the main routines
  912. X   may reset them (and the driver routines may then override that) */
  913. X  SANSONS,        /* Projection mode */
  914. X  FALSE, FALSE,        /* Draw grids */
  915. X  0.5, 5.0,        /* grid step size */
  916. X  0.0, 0.0,        /* grid origin */
  917. X
  918. X  FALSE,        /* Invert (flip north south) */
  919. X};
  920. X
  921. X/* The variables in the first few lines MUST be set by driver */
  922. Xmapwindow mainmap = {
  923. X  880, 500, 20, 265,    /* width, height, x and y offsets */
  924. X  5.9, 2.0, 2.05,    /* default limiting mags for glyph, name, label */
  925. X
  926. X/* The next several variables SHOULD be set by the driver,
  927. X   but are only used by the driver */
  928. X  MAINMAP,        /* Type of map: THUMBNAIL may have
  929. X               some restrictions */
  930. X  0,            /* May be used by driver for whatever */
  931. X  "String",        /* May be used by driver for whatever */
  932. X
  933. X/* The next several variables may be set by the driver, but the main routines
  934. X   may reset them (and the driver routines may then override that) */
  935. X  SANSONS,        /* Projection mode */
  936. X  FALSE, FALSE,        /* Draw grids */
  937. X  0.5, 5.0,        /* grid step size */
  938. X  0.0, 0.0,        /* grid origin */
  939. X
  940. X  FALSE,        /* Invert (flip north south) */
  941. X};
  942. X
  943. X
  944. X/* The variables in the first few lines MUST be set by driver */
  945. Xmapwindow thumbmap = {
  946. X  480, 195, 420, 35,    /* width, height, x and y offsets */
  947. X#ifndef ATARI_ST
  948. X  3.0+THMADJ, 1.0+THMADJ, 2.05+THMADJ,
  949. X#else
  950. X  5.5, 3.5, 4.55,
  951. X#endif
  952. X            /* default limiting mags for glyph, name, label */
  953. X
  954. X/* The next several variables SHOULD be set by the driver,
  955. X   but are only used by the driver */
  956. X  THUMBNAIL,        /* Type of map: THUMBNAIL may have
  957. X               some restrictions */
  958. X  0,            /* May be used by driver for whatever */
  959. X  "String",        /* May be used by driver for whatever */
  960. X
  961. X/* The next several variables may be set by the driver, but the main routines
  962. X   may reset them (and the driver routines may then override that) */
  963. X  SANSONS,        /* Projection mode */
  964. X  FALSE, FALSE,        /* Draw grids */
  965. X  0.5, 5.0,        /* grid step size */
  966. X  0.0, 0.0,        /* grid origin */
  967. X
  968. X  FALSE,        /* Invert (flip north south) */
  969. X};
  970. X
  971. X/* h & v tick text controls */
  972. Xint htick_lim = 2;
  973. Xint htext_lim = 80;
  974. Xint htext_xoff = 2;
  975. Xint htext_yoff = 17;
  976. Xint vtick_lim = 2;
  977. Xint vtext_lim = 20;
  978. Xint vtext_xoff = 24;
  979. Xint vtext_yoff = -4;
  980. X
  981. X/* Scale multiplier, minimum,
  982. X   magnitude change, maximum, for thumbnail,*/
  983. Xdouble th_smul=THSMUL;
  984. Xdouble th_smin=THSMIN;
  985. Xdouble th_madj=THMADJ;
  986. Xdouble th_mmax=THMMAX;
  987. X
  988. X#define MAX(a,b) ((a)>(b)?(a):(b))
  989. X#define MIN(a,b) ((a)<(b)?(a):(b))
  990. X
  991. Xint CURRX, CURRY;
  992. X
  993. X
  994. X
  995. X/* Device control argument */
  996. XD_control_arg(s)
  997. Xchar *s;
  998. X{
  999. X  int i = 0;
  1000. X  int c;
  1001. X  char *p;
  1002. X
  1003. X  switch (*s) {
  1004. X  case 'd':    /* output-device */
  1005. X    device = atoi(&s[1]); /* device immediately after 'd' */
  1006. X      break;
  1007. X  default:
  1008. X    fprintf(stderr,"Wrong device control string!\n");
  1009. X    exit(1);
  1010. X    break;
  1011. X  }
  1012. X}
  1013. X
  1014. X
  1015. X
  1016. Xstatic open_virtual_device()
  1017. X{
  1018. X      int i;
  1019. X          if(appl_init()<0) /* Initialize the application and register it with AES */
  1020. X      {
  1021. X          fprintf(stderr,"could not appl_init !!\n");
  1022. X          exit(1);
  1023. X      }
  1024. X          vdihandle = graf_handle(&i, &i, &i, &i); /* Get a VDI handle */
  1025. X      work_in[0]=(device==31) ? vdihandle:device;
  1026. X      work_in[10]=(device==31) ? 2:0;
  1027. X          v_opnvwk(work_in, &vdihandle, work_out); /* Open the virtual workscreen */
  1028. X      if (vdihandle == 0)
  1029. X      {
  1030. X          fprintf(stderr,"could not open virtual workstation!\n");
  1031. X          appl_exit();
  1032. X          exit(1);
  1033. X      }
  1034. X      work_in[10]=0;
  1035. X}
  1036. X
  1037. X/* Open the device */
  1038. XD_open()
  1039. X{
  1040. X     int i;
  1041. X
  1042. X     if (!vqgdos())
  1043. X     {
  1044. X         fprintf(stderr,"No gdos loaded !!\n");
  1045. X         exit(1);
  1046. X     }
  1047. X
  1048. X     fprintf(stderr,"Device=%d\n",device);
  1049. X     if ((device >= 1)&&(device <= 4))
  1050. X     {
  1051. X      Cursconf(0,0);
  1052. X      open_virtual_device();
  1053. X      v_hide_c(vdihandle);
  1054. X          v_clrwk(vdihandle);
  1055. X          (void)vst_font(vdihandle,1);
  1056. X     }
  1057. X     else
  1058. X     {      int fontindex;
  1059. X           char fontname[33];
  1060. X
  1061. X      if (device == 31)
  1062. X      {
  1063. X          open_virtual_device(); /* seems to be necessary for metafiles*/
  1064. X        work_in[10]=2;
  1065. X        vdihandle_save = vdihandle; /* save handle */
  1066. X      }
  1067. X          work_in[0]=device;
  1068. X          v_opnwk(work_in, &vdihandle, work_out); /* Open the virtual workscreen */
  1069. X      if (vdihandle == 0)
  1070. X      {
  1071. X          fprintf(stderr,"could not open physical workstation!\n");
  1072. X          exit(1);
  1073. X      }
  1074. X          (void)vst_load_fonts(vdihandle, 0);
  1075. X      fontindex = vqt_name(vdihandle,1,fontname);
  1076. X      vst_font(vdihandle, fontindex);
  1077. X     }
  1078. X
  1079. X     if (device == 31)
  1080. X     {
  1081. X       intin[0]=0;
  1082. X       intin[1]=2100;
  1083. X       intin[2]=3050;
  1084. X       v_write_meta(vdihandle,3,intin,0,ptsin);
  1085. X     }
  1086. X     vs_clip(vdihandle, 1, cliparray); /* Set the clipping rectangle */
  1087. X     vsf_color(vdihandle, 1);
  1088. X     vsf_interior(vdihandle, 1);
  1089. X     vsf_perimeter(vdihandle, 0);
  1090. X     vsf_style(vdihandle,8);
  1091. X     vswr_mode(vdihandle, 2);
  1092. X     vst_rotation(vdihandle, 0);
  1093. X     vst_color(vdihandle,1);
  1094. X
  1095. X}
  1096. X
  1097. X#ifdef ATARI_ST
  1098. XD_die(a,b)
  1099. Xchar *a,*b;
  1100. X{
  1101. X    D_close();
  1102. X}
  1103. X#endif
  1104. X
  1105. X/* Close the device */
  1106. XD_close()
  1107. X{
  1108. X     char text[80];
  1109. X     if ((device >=1) && (device <= 4)) /* Screen */
  1110. X     {
  1111. X          gets(text);
  1112. X          v_clsvwk(vdihandle); /* Close the virtual workscreen */
  1113. X          appl_exit(); /* Remove the application from AES */
  1114. X      v_show_c(vdihandle,1);
  1115. X      Cursconf(1,0);
  1116. X     }
  1117. X     else
  1118. X     {
  1119. X      if (device == 31)
  1120. X        v_meta_extents(vdihandle,0,0,0x7fff,0x7fff);
  1121. X        
  1122. X          v_updwk(vdihandle);
  1123. X          v_clswk(vdihandle); /* Close the physical workscreen */
  1124. X
  1125. X      if (device == 31)
  1126. X           {
  1127. X          vdihandle = vdihandle_save;
  1128. X              v_clsvwk(vdihandle); /* Close the virtual workscreen */
  1129. X              appl_exit(); /* Remove the application from AES */
  1130. X          }
  1131. X
  1132. X     }
  1133. X}
  1134. X
  1135. X
  1136. X/* Move to (x, y) */
  1137. XD_move(x, y)
  1138. X     int x, y;
  1139. X{
  1140. X     CURRX = x;
  1141. X     CURRY = y;
  1142. X}
  1143. X
  1144. X
  1145. X/* Draw a line of style line_style from the current point to (x, y) */
  1146. X/* Note, this replaces vecdraw vecdrawdot and vecdrawhyph */
  1147. XD_draw(x, y, line_style)
  1148. X     int x, y;
  1149. X     int line_style;    /* SOLID, DOTTED, DASHED, etc. */
  1150. X{
  1151. X     int line[4];
  1152. X     switch(line_style) {
  1153. X     case SOLID:
  1154. X    vsl_type(vdihandle,1);
  1155. X    break;
  1156. X     case DOTTED:
  1157. X     case VECDOT:
  1158. X    vsl_type(vdihandle,7);
  1159. X         vsl_udsty(vdihandle, 0xaaaa);
  1160. X         break;
  1161. X     case DASHED:
  1162. X     case VECDASH:
  1163. X         vsl_type(vdihandle,5);
  1164. X         break;
  1165. X     default:
  1166. X        vsl_type(vdihandle,1);
  1167. X        break;
  1168. X     }
  1169. X     line[0] = xadjust(CURRX);
  1170. X     line[1] = yadjust(CURRY);
  1171. X     line[2] = xadjust(CURRX = x);
  1172. X     line[3] = yadjust(CURRY = y);
  1173. X     v_pline(vdihandle, 2, line);
  1174. X}
  1175. X
  1176. X/* This routine is encouraged to look at the extern cur_funtion
  1177. X   and change the line style drawn as desired */
  1178. X
  1179. X
  1180. X/* Move to (x1, y1) then draw a line of style line_style to (x2, y2) */
  1181. XD_movedraw(x1, y1, x2, y2, line_style)
  1182. X     int x1, y1, x2, y2;
  1183. X     int line_style;    /* SOLID, DOTTED, DASHED, etc. */
  1184. X{
  1185. X  D_move(x1, y1);
  1186. X  D_draw(x2, y2, line_style);
  1187. X}
  1188. X
  1189. X
  1190. X/* Set the color to be used for lines and text */
  1191. X/* color_str is a 2 char (+ '\0') string containing
  1192. X   a specification for a color,
  1193. X   e.g. "G2" for the color of a star of spectral class G2, or "r7" for
  1194. X   red, level seven.  The interpretation of the color string is left to
  1195. X   the device driver */
  1196. XD_color(color_str)
  1197. X     char *color_str;
  1198. X{
  1199. X  switch (color_str[0]) {
  1200. X  case 'O':
  1201. X    break;
  1202. X  case 'B':
  1203. X    break;
  1204. X  case 'A':
  1205. X    break;
  1206. X  case 'F':
  1207. X    break;
  1208. X  case 'G':
  1209. X    break;
  1210. X  case 'K':
  1211. X    break;
  1212. X  case 'M':
  1213. X    break;
  1214. X  case 'R':
  1215. X  case 'N':
  1216. X  case 'S':
  1217. X    break;
  1218. X  case 'r':
  1219. X  case 'g':
  1220. X  case 'b':
  1221. X  case 'y':
  1222. X  case 'c':
  1223. X  case 'p':
  1224. X  case 'o':
  1225. X  case 'w':
  1226. X    break;
  1227. X  case ' ':
  1228. X  default:
  1229. X    break;
  1230. X  }
  1231. X}
  1232. X
  1233. X
  1234. X/* Set the font and font size to be used for text. */
  1235. X/* Note order of args */
  1236. XD_fontsize(fsize, font)
  1237. X     int fsize;    /* Size of font */
  1238. X     int font;    /* e.g. TIMES, HELV, TIMES+ITALIC */
  1239. X{
  1240. X            (void)vst_point(vdihandle,fsize,&dummy,&dummy,&dummy,&dummy);
  1241. X/*          (void)vst_height(vdihandle,fsize,&dummy,&dummy,&dummy,&dummy);*/
  1242. X}
  1243. X/* This routine is encouraged to look at the extern cur_funtion
  1244. X   and change the font used as desired */
  1245. X
  1246. X
  1247. X/* Display text string str at x,y, in current font and font size.
  1248. X   if star_lbl is TRUE, string is a star label, use
  1249. X     greek characters (if possible) */
  1250. XD_text(x, y, str, star_lbl)
  1251. X     int x, y;
  1252. X     char *str;
  1253. X     int star_lbl;
  1254. X{
  1255. X     int x1,y1;
  1256. X
  1257. X     if (*str == '\0') /* Don't bother if the string is empty */
  1258. X          return;
  1259. X
  1260. X     if (star_lbl) {
  1261. X        /* remove leading spaces */
  1262. X        while (*str == ' ') str++;
  1263. X     /* can't display greek characters */
  1264. X     }
  1265. X
  1266. X     x1 = xadjust(x);
  1267. X     y1 = yadjust(y);
  1268. X     if (y1 > 32750)
  1269. X          y1 = 32750; /* Make sure the bottom line shows up */
  1270. X
  1271. X     vswr_mode(vdihandle, 1);
  1272. X     v_gtext(vdihandle,x1,y1,str);
  1273. X     vswr_mode(vdihandle, 2);
  1274. X
  1275. X
  1276. X}
  1277. X
  1278. X
  1279. X
  1280. X/* Return input coordinate in device coords where there are pointing devices */
  1281. XD_inxy(x, y)
  1282. X     int *x, *y;
  1283. X{
  1284. X}
  1285. X
  1286. X
  1287. X/* Put non-displayed comment in output.  Allowed in postscript, but
  1288. X   few other drivers will be able to support this. */ 
  1289. XD_comment(str)
  1290. X     char *str;
  1291. X{
  1292. X#if 0
  1293. X  fprintf(stderr, "%s\n", str);
  1294. X#endif
  1295. X}
  1296. X
  1297. X
  1298. X/**
  1299. XHigher level functions
  1300. X**/
  1301. X
  1302. X/* Point sizes for font calls */
  1303. X#define TITLESIZE 12
  1304. X#define SUBTLSIZE 12
  1305. X#ifdef NAMESIZE
  1306. X#undef NAMESIZE
  1307. X#endif
  1308. X#define NAMESIZE 7
  1309. X#define LBLSIZE 7
  1310. X#define MAGSIZE 7
  1311. X
  1312. X#ifdef STARIMAGES
  1313. Xint namesize = NAMESIZE;
  1314. Xint lblsize  = LBLSIZE;
  1315. Xint magsize  = MAGSIZE;
  1316. X#endif
  1317. X
  1318. X/* Fonts for font calls */
  1319. X#define NAMEFNT TIMESROMAN
  1320. X#define LBLFNT HELV
  1321. X#define MAGFNT COURIER
  1322. X#define TITLEFNT TIMESBOLD
  1323. X#define SUBTLFNT TIMESROMAN
  1324. X
  1325. X#ifdef STARIMAGES
  1326. Xint namefnt = NAMEFNT;
  1327. Xint lblfnt  = LBLFNT;
  1328. Xint magfnt  = MAGFNT;
  1329. X#endif
  1330. X
  1331. Xint x_nameoffset = 10, y_nameoffset = 0;
  1332. Xint x_lbloffset = 0, y_lbloffset = 10;
  1333. Xint x_magoffset = 15, y_magoffset = -15;
  1334. X
  1335. X
  1336. X#ifndef STARIMAGES
  1337. X
  1338. X/* Interface Function */
  1339. X/* Draw object at x, y.  properties set by other parameters */
  1340. Xdrawobj(x, y, mag, type, color_str, label_field, con_str, obj_name,
  1341. X    comment_str, file_line,
  1342. X    draw_glyph, draw_text, use_lbl, use_name, use_mag)
  1343. X
  1344. X     int x, y;
  1345. X     double mag;    /* Magnitude of object */
  1346. X     char *type;    /* 2 chars, object code and subcode */
  1347. X     char *color_str;    /* 2 chars, spectral type for stars, 
  1348. X               color code otherwise */
  1349. X     char *label_field;    /* 2 chars, Bayer or flamsteed for stars,
  1350. X               size in seconds for nebulae and
  1351. X               planets */
  1352. X     char *con_str;    /* 3 chars, the constellation the object is in */
  1353. X     char *obj_name;    /* Name of object */
  1354. X     char *comment_str;    /* Comment field */
  1355. X     char *file_line;    /* The full line from the file,
  1356. X               containing the above if it is in
  1357. X               standard format */
  1358. X     int draw_glyph;    /* Draw object symbol */
  1359. X     int draw_text;    /* Draw text */
  1360. X     int use_lbl;    /* Label object with the label_field string */
  1361. X     int use_name;    /* Label object with the obj_name string */
  1362. X     int use_mag;    /* Label object with a 2 or 3 character string
  1363. X               containing the magnitude * 10 without
  1364. X               decimal point */
  1365. X{
  1366. X  char magstr[10];
  1367. X
  1368. X/*fprintf(stderr, "%d %d %f <%s> <%s> <%s> <%s> <%s> <%s> <%s>\n", x, y, mag,
  1369. X    type, color_str, label_field, con_str, obj_name, comment_str,
  1370. X    file_line);*/
  1371. X
  1372. X  if (draw_glyph)
  1373. X    switch(type[0]) {
  1374. X    case 'S':    drawStar(x,y,mag,type[1],color_str);
  1375. X      break;
  1376. X    case 'P':    drawPlan(x,y,mag,type[1],color_str, size_obj(label_field),
  1377. X             comment_str);
  1378. X      break;
  1379. X    case 'N':    drawNebu(x,y,mag,type[1],color_str, size_obj(label_field));
  1380. X      break;
  1381. X    case 'G':    drawGalx(x,y,mag,type[1],color_str, size_obj(label_field));
  1382. X      break;
  1383. X    case 'C':    drawClus(x,y,mag,type[1],color_str, size_obj(label_field));
  1384. X      break;
  1385. X    case 'U':
  1386. X      drawUnknown(x,y,mag,type[1],color_str, size_obj(label_field));
  1387. X      break;
  1388. X    case 'O':
  1389. X      drawOther(x,y,mag,type[1],color_str, size_obj(label_field));
  1390. X      break;
  1391. X    case 'V':
  1392. X    case 'A':
  1393. X    case 'I':
  1394. X      break;
  1395. X    case '#':
  1396. X    default:
  1397. X      break;
  1398. X    };
  1399. X
  1400. X
  1401. X/*
  1402. X * use name or label
  1403. X */
  1404. X  if (draw_text) {
  1405. X    if (type[0] == 'I')
  1406. X      D_color(color_str);
  1407. X    else
  1408. X      D_color("  ");
  1409. X
  1410. X    if (use_name && obj_name[0]) {
  1411. X      D_fontsize(NAMESIZE, NAMEFNT);
  1412. X      D_text(x+x_nameoffset, y+y_nameoffset, obj_name, FALSE);
  1413. X    } else if (use_lbl &&
  1414. X           ((label_field[0] != ' ') || (label_field[1] != ' '))) {
  1415. X      D_fontsize(LBLSIZE, LBLFNT);
  1416. X      D_text(x+x_lbloffset, y+y_lbloffset, label_field, TRUE);
  1417. X    }
  1418. X/* If you want to mag label other objects, change this */
  1419. X    if (use_mag && (type[0] == 'S')) {
  1420. X      sprintf(magstr, "%02d", (int)(mag*10.0+0.5));
  1421. X      D_fontsize(MAGSIZE, MAGFNT);
  1422. X      D_text(x+x_magoffset, y+y_magoffset, magstr, FALSE);
  1423. X    }
  1424. X  }
  1425. X}
  1426. X
  1427. XdrawStar(x, y, mag, type, color)
  1428. X    int x, y;
  1429. X    double mag;
  1430. X    char type, *color;
  1431. X{
  1432. X    double mag2,mag3;
  1433. X    mag2 = (250 - (mag+1)*30);
  1434. X    mag2= (mag2<=0)?1:mag2;
  1435. X    vsf_perimeter(vdihandle, 1);
  1436. X    v_circle(vdihandle, (int)xadjust(x), (int)yadjust(y), (int)mag2);
  1437. X    vsf_perimeter(vdihandle, 0);
  1438. X
  1439. X    if ((type == 'V') && (mag<7))
  1440. X    {
  1441. X        mag3 = mag2 * 2.0;
  1442. X        vsf_interior(vdihandle, 0);
  1443. X        vsf_perimeter(vdihandle, 1);
  1444. X        v_circle(vdihandle, (int)xadjust(x), (int)yadjust(y), (int)mag3);
  1445. X        vsf_perimeter(vdihandle, 0);
  1446. X        vsf_interior(vdihandle, 1);
  1447. X    }
  1448. X    else
  1449. X    if (((type == 'B') || (type == 'D')) && (mag<7))
  1450. X    {
  1451. X        int line[4];
  1452. X        line[1]=line[3]=(int)yadjust(y);
  1453. X        line[0]= (int)(xadjust(x)-mag2-(mag2/4.0));
  1454. X        line[2]= (int)(xadjust(x)+mag2+(mag2/4.0));
  1455. X        v_pline(vdihandle, 2, line);
  1456. X    }
  1457. X}
  1458. X
  1459. XdrawPlan(x, y, mag, pcode, color, plansize)
  1460. X     int x,y;
  1461. X     double mag;
  1462. X     char pcode, *color;
  1463. X     long plansize;
  1464. X
  1465. X{
  1466. X     vsf_interior(vdihandle, 0);
  1467. X     drawStar(x, y, mag, 'S', color);
  1468. X     vsf_interior(vdihandle, 1);
  1469. X}
  1470. X
  1471. XdrawGalx(x, y, mag, type, color, nebsize)
  1472. X     int x, y;
  1473. X     double mag;
  1474. X     char type, *color;
  1475. X     long nebsize;        /* -1 should give default size */
  1476. X{
  1477. X     vsf_interior(vdihandle, 0);
  1478. X     vsf_perimeter(vdihandle, 1);
  1479. X     v_ellipse(vdihandle, (int)xadjust(x), (int)yadjust(y),(int)xadjust(12),(int)yadjust(8));
  1480. X     vsf_perimeter(vdihandle, 0);
  1481. X     vsf_interior(vdihandle, 1);
  1482. X}
  1483. X
  1484. XdrawClus(x, y, mag, type, color, nebsize)
  1485. X     int x, y;
  1486. X     double mag;
  1487. X     char type, *color;
  1488. X     long nebsize;        /* -1 should give default size */
  1489. X{
  1490. X     switch(type) {
  1491. X    case 'G': {
  1492. X             int pxyarray[4];
  1493. X             int x1=(int)xadjust(x);
  1494. X        int y1=(int)yadjust(y);
  1495. X        int dx=(int)xadjust(6);
  1496. X        int dy=(int)yadjust(6);
  1497. X
  1498. X        vsf_interior(vdihandle, 0);
  1499. X        vsf_perimeter(vdihandle, 1);
  1500. X/*        v_circle(vdihandle, x1, y1, 300); */
  1501. X        v_ellipse(vdihandle, x1, y1, (int)xadjust(10),(int)yadjust(10));
  1502. X        vsf_perimeter(vdihandle, 0);
  1503. X        vsf_interior(vdihandle, 1);
  1504. X        pxyarray[0]=pxyarray[2]=x1;
  1505. X        pxyarray[1]=y1+dy;
  1506. X        pxyarray[3]=y1-dy;
  1507. X        v_pline(vdihandle, 2, pxyarray);
  1508. X        pxyarray[0]=x1-dx;
  1509. X        pxyarray[2]=x1+dx;
  1510. X        pxyarray[1]=pxyarray[3]=y1;
  1511. X        v_pline(vdihandle, 2, pxyarray);
  1512. X        break;
  1513. X    }
  1514. X         case 'O':
  1515. X         default:
  1516. X        vsf_interior(vdihandle, 0);
  1517. X        vsl_type(vdihandle,3);
  1518. X        /* vsl_type(vdihandle,7);*/
  1519. X        /* vsl_udsty(vdihandle, 0xcccc);*/
  1520. X        vsf_perimeter(vdihandle, 1);
  1521. X        v_arc(vdihandle, (int)xadjust(x), (int)yadjust(y), 300,0,3600);
  1522. X        vsf_perimeter(vdihandle, 0);
  1523. X        vsl_type(vdihandle,1);
  1524. X        vsf_interior(vdihandle, 1);
  1525. X        break;
  1526. X     }
  1527. X}
  1528. X
  1529. XdrawNebu(x, y, mag, type, color, nebsize)
  1530. X     int x, y;
  1531. X     double mag;
  1532. X     char type, *color;
  1533. X     long nebsize;        /* -1 should give default size */
  1534. X{
  1535. X     int pxyarray[4];
  1536. X     int x1=(int)xadjust(x);
  1537. X     int y1=(int)yadjust(y);
  1538. X     int dx=(int)xadjust(5);
  1539. X     int dy=(int)yadjust(5);
  1540. X     /* box of 5 edgelength */
  1541. X     pxyarray[0]= x1 - dx;
  1542. X     pxyarray[1]= y1 - dy;
  1543. X     pxyarray[2]= x1 + dx;
  1544. X     pxyarray[3]= y1 + dy;
  1545. X     vsf_interior(vdihandle, 0);
  1546. X     vsl_type(vdihandle,1);
  1547. X     vsf_perimeter(vdihandle, 1);
  1548. X     v_bar(vdihandle,pxyarray);
  1549. X     vsf_perimeter(vdihandle, 0);
  1550. X     vsl_type(vdihandle,1);
  1551. X     vsf_interior(vdihandle, 1);
  1552. X}
  1553. X
  1554. XdrawUnknown(x, y, mag, type, color, nebsize)
  1555. X     int x, y;
  1556. X     double mag;
  1557. X     char type, *color;
  1558. X     long nebsize;        /* -1 should give default size */
  1559. X{
  1560. X}
  1561. X
  1562. XdrawOther(x, y, mag, type, color, nebsize)
  1563. X     int x, y;
  1564. X     double mag;
  1565. X     char type, *color;
  1566. X     long nebsize;        /* -1 should give default size */
  1567. X{
  1568. X}
  1569. X
  1570. X#else STARIMAGES
  1571. X
  1572. X/*
  1573. X** Draw a horizontal line.
  1574. X*/
  1575. X
  1576. Xdrawlen (x, y, dx, dy, len)
  1577. Xint x, y, dx, dy, len;
  1578. X{
  1579. X/*  D_movedraw(x+dx, y+dy,
  1580. X         x+dx+len,
  1581. X         y+dy, SOLID); another solution ! */
  1582. X#undef DRAWTEST
  1583. X#ifdef DRAWTEST
  1584. X     int line[4],i;
  1585. X     double cx,cy;
  1586. X
  1587. X     cx=xadjust(x);
  1588. X     cy=yadjust(y)+dy*5;
  1589. X
  1590. X     line[0] = cx + dx*5;
  1591. X     line[2] = cx + dx*5 + len*10 - 10;
  1592. X
  1593. X     for (i=-5; i<=5 ; i++)
  1594. X     {
  1595. X         line[1] = line[3] = cy + i;
  1596. X         v_pline(vdihandle, 2, line);
  1597. X     }
  1598. X#else
  1599. X     int line[4];
  1600. X
  1601. X     line[0] = xadjust(x) + dx;
  1602. X     line[2] = xadjust(x) + dx + len - 1;
  1603. X     line[1] = line[3] = yadjust(y) + dy;
  1604. X     v_pline(vdihandle, 2, line);
  1605. X#endif
  1606. X}
  1607. X
  1608. X#endif STARIMAGES
  1609. X
  1610. X/* Functions for areas, drawn as lines for now */
  1611. X/* Move to (x, y) to begin an area */
  1612. XD_areamove(x, y)
  1613. X     int x, y;
  1614. X{
  1615. X  D_move(x, y);
  1616. X}
  1617. X
  1618. X/* Add a segment to the area border */
  1619. XD_areaadd(x, y)
  1620. X     int x, y;
  1621. X{
  1622. X  D_draw(x, y, SOLID);
  1623. X}
  1624. X
  1625. X/* Fill the area, after adding the last segment */
  1626. XD_areafill(x, y)
  1627. X     int x, y;
  1628. X{
  1629. X  D_draw(x, y, SOLID);
  1630. X}
  1631. X
  1632. X
  1633. X/* Variables of positioning are here */
  1634. X#define L_TIL 220
  1635. X#define L_STIL 185
  1636. X
  1637. X#define L_LMAR1 40
  1638. X#define L_LMAR2 65
  1639. X#define L_LTEXT 95
  1640. X#define L_RMAR1 205
  1641. X#define L_RMAR2 230
  1642. X#define L_RTEXT 260
  1643. X
  1644. X#define L_LINE1 150
  1645. X#define L_LINE2 125
  1646. X#define L_LINE3 100
  1647. X#define L_LINE4 75
  1648. X#define L_LINE5 50
  1649. X#define L_LINE6 25
  1650. X
  1651. X
  1652. Xchartlegend(win)
  1653. X     mapwindow *win;
  1654. X{
  1655. X  char ras[20], dls[20], outstr[40];
  1656. X  if (!title[0]) title = "LEGEND";
  1657. X  rastr(ras, win->racen);
  1658. X  declstr(dls, win->dlcen);
  1659. X
  1660. X  if (win->map_type != FULLPAGEMAP) {
  1661. X    sprintf(outstr, "(%s,%s lim: %2.1f)", ras, dls, win->maglim);
  1662. X    D_fontsize(TITLESIZE, TITLEFNT); D_text(L_LMAR1, L_TIL, title, FALSE);
  1663. X    D_fontsize(SUBTLSIZE, SUBTLFNT); D_text(L_LMAR1, L_STIL, outstr, FALSE);
  1664. X    
  1665. X    drawStar(L_LMAR2, L_LINE1, 0.0, 'S', "  ");
  1666. X    D_fontsize(NAMESIZE, NAMEFNT);
  1667. X    D_text(L_LTEXT, L_LINE1,"<0.5", FALSE);
  1668. X    if (win->maglim >= 0.5)
  1669. X      {
  1670. X    drawStar(L_RMAR2, L_LINE1, 1.0, 'S', "  ");
  1671. X    D_fontsize(NAMESIZE, NAMEFNT);
  1672. X    D_text( L_RTEXT, L_LINE1,"<1.5", FALSE);
  1673. X      }
  1674. X    if (win->maglim >= 1.5)
  1675. X      {
  1676. X    drawStar(L_LMAR2, L_LINE2, 2.0, 'S', "  ");
  1677. X    D_fontsize( NAMESIZE, NAMEFNT);
  1678. X    D_text(L_LTEXT, L_LINE2,"<2.5", FALSE);
  1679. X      }
  1680. X    if (win->maglim >= 2.5)
  1681. X      {
  1682. X    drawStar(L_RMAR2, L_LINE2, 3.0, 'S', "  ");
  1683. X    D_fontsize( NAMESIZE, NAMEFNT);
  1684. X    D_text(L_RTEXT, L_LINE2,"<3.5", FALSE);
  1685. X      }
  1686. X    if (win->maglim >= 3.5)
  1687. X      {
  1688. X    drawStar(L_LMAR2, L_LINE3, 4.0, 'S', "  ");
  1689. X    D_fontsize( NAMESIZE, NAMEFNT);
  1690. X    D_text(L_LTEXT, L_LINE3,"<4.5", FALSE);
  1691. X      }
  1692. X    if (win->maglim > 4.5)
  1693. X      {
  1694. X    drawStar(L_RMAR2, L_LINE3, 5.0, 'S', "  ");
  1695. X    D_fontsize( NAMESIZE, NAMEFNT);
  1696. X    D_text(L_RTEXT, L_LINE3,">4.5", FALSE);
  1697. X      }
  1698. X    
  1699. X    D_fontsize(NAMESIZE, NAMEFNT);
  1700. X    D_text(L_LTEXT,L_LINE4,"double", FALSE);
  1701. X    drawStar(L_LMAR2,L_LINE4,2.0, 'D', "  ");
  1702. X    D_fontsize(NAMESIZE, NAMEFNT);
  1703. X    D_text(L_RTEXT,L_LINE4,"variable",FALSE);
  1704. X    drawStar(L_RMAR2,L_LINE4,2.0, 'V', "  ");
  1705. X
  1706. X    D_fontsize(NAMESIZE, NAMEFNT);
  1707. X    D_text(L_LTEXT,L_LINE5,"planet", FALSE);
  1708. X    drawPlan(L_LMAR2,L_LINE5,1.0, ' ', "  ", (long) -1);
  1709. X
  1710. X    D_fontsize(NAMESIZE, NAMEFNT);
  1711. X    D_text(L_RTEXT,L_LINE5,"galaxy", FALSE);
  1712. X    drawGalx(L_RMAR2,L_LINE5,1.0, 'E', "  ", (long) -1);
  1713. X    drawGalx(L_RMAR1,L_LINE5,1.0, 'S', "  ", (long) -1);
  1714. X
  1715. X    D_fontsize(NAMESIZE, NAMEFNT);
  1716. X    D_text(L_LTEXT,L_LINE6,"nebula", FALSE);
  1717. X    drawNebu(L_LMAR2,L_LINE6,1.0, 'D', "  ", (long) -1);
  1718. X    drawNebu( L_LMAR1,L_LINE6,1.0, 'P', "  ", (long) -1);
  1719. X
  1720. X    D_fontsize(NAMESIZE, NAMEFNT);
  1721. X    D_text(L_RTEXT,L_LINE6,"cluster", FALSE);
  1722. X    drawClus(L_RMAR2,L_LINE6,1.0, 'O', "  ", (long) -1);
  1723. X    drawClus(L_RMAR1,L_LINE6,1.0, 'G', "  ", (long) -1);
  1724. X  } else {
  1725. X    D_fontsize(NAMESIZE, NAMEFNT);
  1726. X
  1727. X    sprintf(outstr, "%s: %s,%s lim: %2.1f", title, ras, dls, win->maglim);
  1728. X    D_text(15, 15, outstr, FALSE);
  1729. X  }
  1730. X}
  1731. END_OF_FILE
  1732. if test 21986 -ne `wc -c <'starchart/starst.c'`; then
  1733.     echo shar: \"'starchart/starst.c'\" unpacked with wrong size!
  1734. fi
  1735. # end of 'starchart/starst.c'
  1736. fi
  1737. echo shar: End of archive 12 \(of 32\).
  1738. cp /dev/null ark12isdone
  1739. MISSING=""
  1740. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ; do
  1741.     if test ! -f ark${I}isdone ; then
  1742.     MISSING="${MISSING} ${I}"
  1743.     fi
  1744. done
  1745. if test "${MISSING}" = "" ; then
  1746.     echo You have unpacked all 32 archives.
  1747.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1748. else
  1749.     echo You still need to unpack the following archives:
  1750.     echo "        " ${MISSING}
  1751. fi
  1752. ##  End of shell archive.
  1753. exit 0
  1754.  
  1755.